export class Regulars {
    /**
     * 密码规则
     */
    public static pasRegular = /^(?![0-9]+$)(?![a-zA-Z]+$)(?![!@#$%^&*()_+,.?/<>|]+$)[0-9A-Za-z]{6,20}$/;
    /**
     * 邮箱规则
     */
    public static mailRegular = /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.)[a-z0-9]+$/;

    /**
     * 国内手机正则
     */
    public phoneRegular = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/;


    /**
     * 比较两个密码是否一致
     * @param pwd 
     * @param pwd2 
     */
    public static comparePwd(pwd: string, pwd2: string) {
        if (this.pasRegular.test(pwd)) {
            return false;
        }
        if (pwd != pwd2) {
            return false;
        }
        return true;
    }
}